package com.xbongbong.pro.team;

import com.xbongbong.paas.field.FieldAttrEntity;
import com.xbongbong.paas.toolbox.wrap.UserVO;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.util.Map;
import java.util.Set;

/**
 * @author: 汪腾伟
 * @date: Created in 2022/1/19 10:39
 * @description： 团队中共享/隔离模式处理中用于流转的中间实体
 */
@Setter
@Getter
@ToString
public class TeamModelProcessMidPOJO {

    /**
     * 模式：0:共享 1:隔离
     */
    private Integer model;

    /**
     * 公司id
     */
    private String corpid;

    /**
     * 主业务数据id，比如客户团队，这里就代表客户id
     */
    private Long dataId;

    /**
     * 业务类型
     */
    private Integer businessType;

    /**
     * 新增负责人列表
     */
    private Set<String> newAddMainUserList;

    /**
     * 协同人变为负责人列表，保留最后一个负责人的校验时需要用到
     */
    private Set<String> updateCoToMainUserList;

    /**
     * 负责人变为协同人列表
     */
    private Set<String> updateMainToCoUserList;

    /**
     * 删除负责人列表
     */
    private Set<String> newDelMainUserList;

    /**
     * 新增协同人列表
     */
    private Set<String> newAddCoUserList;

    /**
     * 删除协同人列表
     */
    private Set<String> newDelCoUserList;

    /**
     *  是否来自继承，false不是
     */
    private Boolean isInheritance;

    /**
     * 负责人字段
     */
    private FieldAttrEntity ownerField;

    /**
     * 协同人字段
     */
    private FieldAttrEntity coUserField;

    /**
     * 老的负责人列表
     */
    private Set<String> oldMainUserList;

    /**
     * 老的协同人列表
     */
    private Set<String> oldCoUserList;

    /**
     * 需要权限判断的时候用到
     */
    private UserVO loginUser;

    /**
     * 是否从tab页操作 true:代表是  false:代表否
     */
    private Boolean fromDetail;

    /**
     * 需要被替换的负责人（移交功能使用）
     */
    private String originUserId;

    /**
     * 替换的负责人
     */
    private String changeUserId;

    /**
     * 主数据id和名称/编号的一个map
     */
    private Map<Long, String> nameOrSeriNoMap;

    /**
     * 隔离模式下团队负责人和协同人的对应关系
     */
    private Map<String, Set<String>> oldTeamCoUserRelMap;
    /**
     * 来自退回公海池操作，true来自公海池，false非公海池操作
     */
    private Boolean fromBackPublic = false;

    /**
     * 操作标识
     * @see com.xbongbong.saas.enums.UserTeamOperateTagEnum
     */
    private Integer operateTag;

    private Integer saasMark;

    private String teamUserId;

    /**
     * 平台 web：pc浏览器；dingtalk：钉钉；all：全部
     */
    private String platform;
    /**
     * 是否来自导入覆盖
     */
    private Boolean fromCover = false;

    /**
     * 表单id
     */
    private Long formId;

    public TeamModelProcessMidPOJO() {
    }

    public TeamModelProcessMidPOJO(Integer model, String corpid, Long dataId, Integer businessType, Set<String> newAddMainUserList, Set<String> updateCoToMainUserList,Set<String> updateMainToCoUserList, Set<String> newDelMainUserList,
                                   Set<String> newAddCoUserList, Set<String> newDelCoUserList, Boolean isInheritance, FieldAttrEntity ownerField, FieldAttrEntity coUserField,
                                   Set<String> oldMainUserList, Set<String> oldCoUserList, UserVO loginUser, Boolean fromDetail, String originUserId, String changeUserId,
                                   Map<Long, String> nameOrSeriNoMap, Map<String, Set<String>> oldTeamCoUserRelMap, Boolean fromBackPublic,
                                   Integer operateTag, Integer saasMark,  String teamUserId, String platform, Boolean fromCover, Long formId) {
        this.model = model;
        this.corpid = corpid;
        this.dataId = dataId;
        this.businessType = businessType;
        this.newAddMainUserList = newAddMainUserList;
        this.updateCoToMainUserList = updateCoToMainUserList;
        this.updateMainToCoUserList = updateMainToCoUserList;
        this.newDelMainUserList = newDelMainUserList;
        this.newAddCoUserList = newAddCoUserList;
        this.newDelCoUserList = newDelCoUserList;
        this.isInheritance = isInheritance;
        this.ownerField = ownerField;
        this.coUserField = coUserField;
        this.oldMainUserList = oldMainUserList;
        this.oldCoUserList = oldCoUserList;
        this.loginUser = loginUser;
        this.fromDetail = fromDetail;
        this.originUserId = originUserId;
        this.changeUserId = changeUserId;
        this.nameOrSeriNoMap = nameOrSeriNoMap;
        this.oldTeamCoUserRelMap = oldTeamCoUserRelMap;
        this.fromBackPublic = fromBackPublic;
        this.operateTag = operateTag;
        this.saasMark = saasMark;
        this.teamUserId = teamUserId;
        this.platform = platform;
        this.fromCover = fromCover;
        this.formId = formId;
    }
}
